import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-expect-error忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'virtual:svg-icons-register'
import globalComponents from '@/components'
// 引入样式
import '@/styles/index.scss'
import router from './router'
import pinia from './store'

const app = createApp(App)
// 安装中英文切换
app.use(ElementPlus, {
  locale: zhCn,
})
// 安装自定义组件
app.use(globalComponents)
// 路由
app.use(router)
// 引入Pinia
app.use(pinia)

// 引入路由鉴权，然它执行一次代码
import './permission'

app.mount('#app')
